<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var d = new Date()
        var n = d.getFullYear()
        var m = d.getMonth()+1
        var dd = d.getDate()
        var s = d.getHours()
        var f = d.getMinutes()
        var mm = d.getSeconds()
        document.write("今天是：" +n + "年" + m + "年" + dd + "年" + s + "年" + f + "年" + mm + "年")

        var dat = new Date()
        // getTime() 返回一个值 -- 距离1970年的毫秒数----1秒 =
        document.write(dat.getTime())
    </script>
</body>
</html>